import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import codeConfig from '@/utils/codeConfig'
import Directives from '@/directives' // 自定义指令
import * as filters from '@/utils/filters'
import 'amfe-flexible' // 设置font-size基准值

import vant from 'vant' // 全量引入，实际使用建议按需引入
import 'vant/lib/index.css'

import VueAwesomeSwiper from 'vue-awesome-swiper' // swiper
import 'swiper/swiper-bundle.css' // swiper.css

import ECharts from 'vue-echarts' // 在 webpack 环境下指向 components/ECharts.vue
// 手动引入 ECharts 各模块来减小打包体积
import 'echarts/lib/chart/bar'
import 'echarts/lib/component/tooltip'
import 'echarts/lib/chart/line'
import 'echarts/lib/component/polar'
import 'echarts/lib/component/legend'
import 'echarts/lib/component/title.js'
import "echarts/lib/chart/pie"

import '@/assets/styles/index.less'


Vue.use(Directives)
Vue.component('v-chart', ECharts)
Vue.use(vant)
Vue.use(VueAwesomeSwiper)
Vue.prototype.$codeConfig = codeConfig
Vue.config.productionTip = false

// 加载全局过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
